Skip to content

Instantly share code, notes, and snippets.

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@bmaupin
bmaupin / free-backend-hosting.md
Last active May 12, 2024 19:17
Free backend hosting
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active May 12, 2024 19:12
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@zmts
zmts / tokens.md
Last active May 12, 2024 19:11
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 12, 2024 19:11
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@EmNudge
EmNudge / server.js
Last active May 12, 2024 19:10
Minimal Live Reload
const listeners = new Set();
const addSubscriber = (res) => {
res.writeHead(200, {
"Content-Type": "text/event-stream",
Connection: "keep-alive",
"Cache-Control": "no-cache",
});
listeners.add(res);
};
@lfender6445
lfender6445 / gist:9919357
Last active May 12, 2024 19:09
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@romain-trotard
romain-trotard / UnderTheHoodOfReactEventListener.md
Last active May 12, 2024 19:09
Under the hood of event listeners in React

Recently, during the migration to React 17, I had a problem between event listeners handled by React and one added document manually. It was due to this part on the React 17 release note.

At this moment I understood that I had a misconception of how React handles event listener. So I decided to explore the React code to understand how it works.

The misconception

Before going deep in the React codebase, I would like to explain what was in my head about the management of event listeners.

For example when I write this simple code:

// Copyright (c) 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ComputedStyleBase_h
#define ComputedStyleBase_h
#include "core/style/ComputedStyleConstants.h"
#include "core/CoreExport.h"
#include "core/style/DataRef.h"
@Softwave
Softwave / README.md
Last active May 12, 2024 19:08
Fibonacci Program

Fib

Simple fibonacci number calculator.

Usage: fib nth Fibonacci number